package com.spring.util;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.PropertyConfigurator;

public class Log4jInitServlet extends HttpServlet {

	

	/**
	 * 
	 */
	private static final long serialVersionUID = 8339573565046459948L;

	public Log4jInitServlet() {
		super();
	}

	public void destroy() {
		super.destroy(); 
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		super.doGet(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		super.doPost(request, response);
	}

	public void init() throws ServletException {
		
		System.setProperty("webappRoot", getServletContext().getRealPath("/"));
		PropertyConfigurator.configure(getServletContext().getRealPath("/") + getInitParameter("configfile")); 
	}

}
